<template>
  <el-dialog :modelValue="show" title="总代信息" width="55%" top="8vh" :close-on-press-escape="false" :destroy-on-close="true" :close-on-click-modal="false"
    @close="handleClose">
    <el-form :model="data.addQuery" class="dialogMaxHeight" ref="addQuery" :rules="data.rules" status-icon
      :validate-on-rule-change="false" :scroll-to-error="true">
      <form-item title="总代类型" value="is_multi_currency">
        <el-radio-group v-model="data.addQuery.is_multi_currency" @change="chooseType" size="large"
          :disabled="props.checkedItem.id?true:false">
          <el-radio-button label="正常总代" :value="0" />
          <el-radio-button label="多货币总代" :value="1" />
        </el-radio-group>
      </form-item>
      <form-item title="是否是测试总代" value="operator_type">
        <el-radio-group v-model="data.addQuery.operator_type" size="large">
          <el-radio-button label="否" :value="0" />
          <el-radio-button label="测试总代" :value="1" />
        </el-radio-group>
      </form-item>
      <form-item title="是否是KOL总代" value="kol" v-show="data.addQuery.operator_type">
        <el-radio-group v-model="data.addQuery.kol" size="large">
          <el-radio-button label="否" :value="0" />
          <el-radio-button label="KOL" :value="1" />
        </el-radio-group>
      </form-item>
      <form-item title="总代昵称" :pass="true" value="operator_name">
        <el-input clearable placeholder="请输入" :disabled="data.accountTypeShow" maxlength="20"
          v-model="data.addQuery.operator_name" />
      </form-item>
      <form-item title="后台账号" :pass="true" value="username">
        <el-input clearable placeholder="请输入" autocomplete="off" :disabled="props.checkedItem.id?true:false" maxlength="50"
          v-model="data.addQuery.username" />
      </form-item>
      <form-item title="后台密码" :pass="data.rules.password[0].required" value="password">
        <el-input clearable placeholder="请输入" autocomplete="new-password" type="password"
          v-model="data.addQuery.password" />
      </form-item>
      <!-- 品牌 6 7 9 最低分成比例为5 -->
      <form-item :title="!indexStore.is_general_agent?'GGR分成比例':'平台费用分成比例'" :pass="true" value="config_ggr">
        <div class="flexWrap">
          <div class="flex marginL10 marginB10" v-for="(item, index) in data.addQuery.config_ggr" :key="index">
            <div class="width70px">{{ selectToLabel(GameBrandNum, item.platform) }}:</div> <el-input-number class="width200" v-model="item.radio" :min="0" :max="100" :precision="2"
            placeholder="请输入0-100数字" clearable controls-position="right"/>%
          </div>
        </div>
      </form-item>
      <form-item title="返佣比例" value="share_proportion">
        <el-input-number class="width200" v-model="data.addQuery.share_proportion" :min="0" :max="100" :precision="2"
          placeholder="请输入0-100数字" clearable controls-position="right"/>
      </form-item>
      <form-item title="结算比例" value="settlement_ratio" v-if="!indexStore.is_general_agent">
        <el-input-number class="width200" v-model="data.addQuery.settlement_ratio" :min="1" :max="999999999999999999" :precision="2"
          placeholder="请输入0-100数字" clearable controls-position="right" />：1
          <span class="tipsText">(填写此总代/商户的货币结算比例值，相关报表数据会除以此数值显示)</span>
      </form-item>
      <form-item title="地区选择" :pass="true" value="area" v-show="data.addQuery.is_multi_currency ? true : false">
        <el-select v-model="data.addQuery.area" filterable placeholder="请选择">
          <el-option v-for="(item, index) in COUNTRY" :key="index" :label="item.label" :value="item.value" />
        </el-select>
        <span class="tipsText">(推广平台的地区,下拉搜索选择)</span>
      </form-item>
      <form-item title="API接入模式" :pass="true" value="api_type" v-show="data.addQuery.is_multi_currency ? true : false">
        <el-select v-model="data.addQuery.api_type" placeholder="请选择" :disabled="data.accountTypeShow">
          <el-option v-for="item in APITYPE" :key="item.value" :label="item.label" :value="item.value" />
        </el-select>
      </form-item>
      <form-item title="结算货币" :pass="true" value="currencyList"  v-show="data.addQuery.is_multi_currency ? true : false">
        <el-select class="imWidth100" :disabled="props.checkedItem.status?true:false" v-model="data.addQuery.currencyList" filterable multiple placeholder="请选择" @change="chooseCurrency">
          <el-option label="全部" :value="-1" />
          <el-option v-for="(item, index) in indexStore.currentArray" :key="index"
            :label="item.label + ' (' + item.type + ')' + '-' + item.remark" :value="item.value" />
        </el-select>
        <span class="tipsText">(选择的货币游戏内即显示对应的货币符号)</span>
      </form-item>
      <form-item title="客户端显示缩小倍数" value="client_balance_scales" v-show="data.addQuery.is_multi_currency ? true : false">
        <div class="flexWrap">
          <div class="margin5 marginR10" v-for="(item,index) in data.addQuery.client_balance_scales" :key="index">
            {{ item.label }} :  <el-input-number class="width130" :disabled="props.checkedItem.status?true:false" v-model="item.multiple" :min="1" :max="999999999999999999" :precision="8"
            placeholder="请输入" clearable :controls="false" />
          </div>
        </div>
        <span class="tipsText">(此商户的游戏内显示余额相关会除以设定值；<span class="tipsTextRed">*若再次编辑此设定值，需将关闭此商户API，保存后再手动开启</span>)</span>
      </form-item>
      <form-item title="预存分功能" value="pre_score_status" v-show="data.addQuery.is_multi_currency ? true : false">
        <el-radio-group class="marginR15" v-model="data.addQuery.pre_score_status" size="large" @change="changeStatus">
          <el-radio-button label="关闭" :value="0" />
          <el-radio-button label="开启" :value="1" />
        </el-radio-group>
        <div v-if="data.addQuery.pre_score_status">
          <div class="marginT10 marginB5">
            当月默认预存分数：<el-input-number class="width180 marginR15" v-model="data.addQuery.pre_store_score" :min="0" :max="999999999999999999" :precision="0"
            placeholder="请输入0-100数字" clearable controls-position="right" />
            <span class="tipsTextRed marginT5">(此功能开启后，赋予商户一个分数值，当此商户的当月总输赢值超过分数值的设定百分比后会自动关闭此商户的API状态，关闭后商户无法再请求平台游戏接口;)</span>
          </div>
          超过分数百分比关闭API：<el-input-number class="width150" v-model="data.addQuery.pre_score_percent" :min="0" :max="999999999999999999" :precision="0"
          placeholder="请输入0-100数字" clearable controls-position="right" />%
          <span class="tipsTextRed marginT5">(超过分数百分比关闭API：在100%的基础填写超过分数百分比，可为0，0 即为超过“预存分数”值即自动关闭商户；自动关闭商户API的预存分数阈值计算为：预存分数*(100+此设定值)%)</span>
          <p class="tipsText">*特殊说明：修改预存分值现在有两处入口；区别说明如下：</p>
          <div class="tipsTextRed">
            <p>1.商户列表处修改预存分值，仅修改当月的值。在原有基础（每月默认+上月结余）上进行增扣，仅对当月有效；</p>
            <p>2.创建/编辑内修改商户的预存分值即修改此商户的每月预存分默认值，此处修改后此商户当前的预存分值不会重新计算；仅修改每月默认值</p>
          </div>
        </div>
      </form-item>
      <form-item title="总代游戏" value="game_ids" :pass="true" style="height: auto;" v-show="data.addQuery.is_multi_currency ? true : false">
        <div class="width100" v-show="item.show" v-for="(item, index) in data.gameBrandList" :key="index">
          <div class="box-title" v-show="item.label.length">
            {{ item.remark }} (<span class="colorRed">{{ item.num }}</span>)
          </div>
          <el-checkbox class="margin5" label="全选游戏" v-model="item.all" border :indeterminate="item.isIndeterminate" @change="handleCheckAllGame(item)" v-show="item.label.length" />
          <el-checkbox-group v-model="item.game" @change="handleCheckGame(item)">
            <el-checkbox class="width23 margin5" v-for="(second, two) in item.label" :key="two"  :value="second.value" border v-show="item.label.length">
              <div class="flexCenter">
                <img class="game-icon" :src="selectToLabel(GAMEICON, second.value)" alt="">
                {{ selectToLabel(indexStore.gameArray, second.value) }}
              </div>
            </el-checkbox>
          </el-checkbox-group>
        </div>
      </form-item>
      <form-item title="PG游戏货币符号展示开关" value="is_show_coin_icon" v-if="!indexStore.is_general_agent">
        <el-radio-group v-model="data.addQuery.is_show_coin_icon" size="large">
          <el-radio-button label="关闭" :value="0" />
          <el-radio-button label="开启" :value="1" />
        </el-radio-group>
      </form-item>
      <form-item title="总代秘钥" value="key" :pass="data.rules.key[0].required"
        v-show="data.addQuery.is_multi_currency ? true : false">
        <div class="inputAndBtn">
          <el-input class="width320" clearable placeholder="请输入" v-model="data.addQuery.key" />
          <el-button class="marginL5" size="small" type="primary" @click="autoKey">生成秘钥</el-button>
          <span class="tipsText">(非必填-该秘钥为总代填写，总代账号只做展示和修改)</span>
        </div>
      </form-item>
      <form-item title="第三方接口域名" value="domain_name" :pass="data.rules.domain_name[0].required"
        v-show="data.addQuery.is_multi_currency ? true : false">
        <el-input class="width320" clearable placeholder="请输入" v-model="data.addQuery.domain_name">
          <template #prepend>https://</template>
        </el-input>
        <span class="tipsText">({{ t('des_23') }})</span>
      </form-item>
      <form-item title="联系方式：" value="contact">
        <el-input clearable placeholder="请输入" v-model="data.addQuery.contact" />
      </form-item>
      <form-item title="备注：" value="remark">
        <el-input clearable maxlength="200" type="textarea" :checkedItems="3" placeholder="请输入"
          v-model="data.addQuery.remark" />
      </form-item>
      <GoogleCaptcha ref="GoogleRef" :checkedItem="data.addQuery" />
    </el-form>
    <template #footer>
      <div class="dialog-footer">
        <el-button @click="handleClose">取消</el-button>
        <el-button type="primary" v-loading="indexStore.moduleLoading" @click="setOperator">保存</el-button>
      </div>
    </template>
  </el-dialog>
</template>

<script lang="ts" setup>
import { ref, reactive, watch } from 'vue'
import type { FormInstance } from 'element-plus'
import { ElMessage,ElMessageBox } from 'element-plus'
import GoogleCaptcha from '@/components/GoogleCaptcha.vue'
import { APITYPE, GAMEICON, GameBrandNum, CurrencyGameDisabled } from '@/config/eunm'
import { COUNTRY } from '@/config/country'
import { selectToLabel, removeDomain, domainVerification, sortObjectArray, sortArray, ArrayContain } from '@/utils/index'
import { addOperator, editOperator, getAgentKey } from '@/api/merchant'

import { useStore } from '@/stores/index'
const indexStore = useStore()
import { useI18n } from 'vue-i18n'
const { t } = useI18n()

const props = defineProps({
  show: Boolean,
  checkedItem: {
    type: Object,
    default: () => { }
  },
  globalService: {
    type: Array,
    default: () => []
  },
})

const data = reactive({
  addQuery: {
    id: 0, // 总代id
    operator_name: '', //总代名称
    username: '', // 后台账号
    password: '', // 后台密码
    contact: '', //联系方式
    remark: '', // 备注
    operator_type: 0, // 是否是测试总代
    kol: 0, // 是否是kol
    white_ip: '', // IP白名单
    google_check: 0, // IP白名单
    google_url: '', // 谷歌二维码
    google_secret: '', // 谷歌二维码
    google_code: 0, // 谷歌验证码
    settlement_ratio: 1,// 结算比例
    slot_ratio: null, // slot 分成比例 百分比
    share_proportion: null, // 返佣比例
    config_ggr: [] as any, // 分成比例
    // 多货币
    is_multi_currency: 0, // 0普通 1多货币
    is_show_coin_icon: 1, // pg货币是否显示
    currency_ids: '', // 币种
    currencyList: [] as any[], // 多货币-币种
    client_balance_scales: [] as any[], // 多货币-币种放大倍数
    pre_score_status: 0, // 预存分
    pre_store_score: 10000, // 分数
    pre_score_percent: 10, // 百分比
    domain_name: '', // 接口域名
    key: '', // 秘钥
    area: '', //地区选择
    agent_request_url: '',// 商户请求地址
    api_type: 0, //  0单一 1转账
    game_ids: '', //  默认游戏ID
    gameList: [] as any[], // 商户游戏
  },
  rules: {
    operator_name: [{ required: true, message: '请输入', trigger: 'blur' }],
    username: [{ required: true, message: '请选择', trigger: 'change' }],
    password: [
      { required: true, message: '请输入', trigger: 'blur' },
      { min: 6, max: 20, message: '请输入6-20位字符', trigger: 'blur' }
    ],
    currency_ids: [{ required: false, message: '请输入', trigger: 'blur' }],
    domain_name: [{ required: false, message: '请输入', trigger: 'blur' }],
    key: [{ required: false, message: '请输入', trigger: 'blur' }],
    area: [{ required: false, message: '请输入', trigger: 'blur' }],
    slot_ratio: [{ required: true, message: '请输入0-100数字', trigger: 'blur' }],
  },
  gameBrandList: [] as any[],
  accountTypeShow: true,
})

watch(
  () => [props.checkedItem, props.show, props.globalService],
  async (value) => {
    if(value[0] && value[1]){
      props.checkedItem.domain_name = removeDomain(props.checkedItem.domain_name)
      Object.assign(data.addQuery, value[0])
      console.log('总代信息：',data.addQuery);
      chooseType(props.checkedItem.is_multi_currency)
      data.rules.password[0].required = data.addQuery.id ? false : true
      data.rules.key[0].required = data.addQuery.key ? true : false
      data.rules.domain_name[0].required = data.addQuery.domain_name ? true : false
      // 货币放大倍数(多货币)
      if(data.addQuery.is_multi_currency){
        data.addQuery.client_balance_scales = []
        let arr = props.checkedItem.client_balance_scales?props.checkedItem.client_balance_scales.split(','):[]
        data.addQuery.currencyList.forEach((id:number,index:number)=>{
          if(arr.length){
            arr.forEach((scales:number,two:number)=>{
              if(index==two){
                data.addQuery.client_balance_scales.push({label:selectToLabel(indexStore.currentArray,id),multiple: Number(scales)})
              }
            })
          }else{
            data.addQuery.client_balance_scales.push({label:selectToLabel(indexStore.currentArray,id),multiple: 1})
          }
        })
      }
    }
    if(value[1]){
      setGameBrand()
      data.accountTypeShow = indexStore.is_general_agent && props.checkedItem.id ? true:false // 区别总代-中控
    }
  }
)

// 保存
const emit = defineEmits(['cancel'])
const setOperator = async () => {
  if (!addQuery.value) return
  await addQuery.value.validate(async (valid, fields) => {
    if (valid) {
      let query = JSON.parse(JSON.stringify(data.addQuery)),gameList = [] as number[],scales = [] as number[];
      // 多货币总代
      if (query.is_multi_currency) {
        // 处理选中的游戏
        data.gameBrandList.forEach((item:any)=>{
          item.game.forEach((second:any) => {
            gameList.push(second)
          })
        })
        query.game_ids = sortArray([...new Set(gameList)] ,'asc').join(',')
        if (!query.game_ids) {
          return ElMessage.error('请选择总代游戏')
        }
        // 货币
        const all = query.currencyList.find((item: number) => item == -1)
        if (all) {
          query.currencyList = []
          indexStore.currentArray.forEach((item:any)=>{
            query.currencyList.push(item.value)
          })
        }
        query.currency_ids = query.currencyList.join(',')
        if (!query.currency_ids) {
          return ElMessage.error('请选择总代货币')
        }
        // 货币总代-放大倍数
        data.addQuery.client_balance_scales.forEach((item:any)=> {
          scales.push(item.multiple?item.multiple:1)
        })
        query.client_balance_scales = scales.join(',')
      } else {
        query.currency_ids = ''
        query.game_ids = ''
        query.client_balance_scales = ''
      }
      // 正常总代--kol为否
      if(!query.operator_type){
        query.kol = 0
      }
      query =  GoogleRef.value.returnGoogle(query)
      if(query.google_check && !query.google_code) {
        return ElMessage.error('请输入谷歌验证码')
      }
      // 域名格式校验
      query.domain_name = domainVerification(query.domain_name)
      indexStore.setModuleLoading(true)
      const res = query.id ? await editOperator(query) : await addOperator(query)
      if (res.code) {
        ElMessage.success('操作成功')
        indexStore.getOperator() //总代汇总
        query = null
        handleClose(true)
      }
    }
  })
}

// 选择总代类型
const chooseType = async (value: any) => {
  if(!data.addQuery.id){
    data.addQuery.gameList = []
  }
  if (value) {
    data.rules.currency_ids[0].required = true
    data.rules.area[0].required = true
    // 默认选中所有游戏
    data.gameBrandList.forEach((item:any)=>{
      item.label.forEach((second:any)=> {
        item.game.push(second.value)
      })
    })
  } else {
    data.rules.currency_ids[0].required = false
    data.rules.area[0].required = false
    // 默认取消选中所有游戏
    data.gameBrandList.forEach((item:any)=>{
      item.label.forEach((second:any)=> {
        item.game = []
      })
    })
  }
}

// 选择多货币
const chooseCurrency = async (val:any) => {
  const all = val.find((item: number) => item == -1)
  let allCurrency = [] as any[];
  if (all) {
    indexStore.currentArray.forEach((item:any)=>{
      allCurrency.push(item.value)
    })
    data.addQuery.currencyList = [-1] as any
  } else {
    data.addQuery.currencyList = val
    allCurrency = val
  }

  let oldArr = JSON.parse(JSON.stringify(data.addQuery.client_balance_scales))
  data.addQuery.client_balance_scales = []
  allCurrency.forEach((item:number) => {
    let multiple = 1
    oldArr.forEach((second:any) => {
      if(second.label == selectToLabel(indexStore.currentArray,item)){
        multiple = second.multiple
      }
    })
    data.addQuery.client_balance_scales.push({label:selectToLabel(indexStore.currentArray,item),multiple: multiple})
  })
  // 选择货币【禁止货币对应的游戏】
  CurrencyGame()
}
// 选择货币【禁止货币对应的游戏】
const CurrencyGame = ()=>{
  // 填充禁止选择货币
  let dataDisabled = [] as number[];
  CurrencyGameDisabled.forEach((item:any)=>{
    dataDisabled.push(item.value)
  })
  // 处理游戏是否选中【货币禁止显示游戏】
  if(ArrayContain(data.addQuery.currencyList,dataDisabled)){
    dataDisabled.forEach((currency:number)=>{
      data.addQuery.currencyList.forEach((item:any)=>{
        if(currency == item){
          let disabled = selectToLabel(CurrencyGameDisabled,currency,'disabled','value')
          data.gameBrandList.forEach((second:any)=>{
            if(second.value == disabled){
              second.show = false
              second.game = []
            }
          })
        }
      })
    })
  }else{
    data.gameBrandList.forEach((item:any)=>{
      item.show = true
      item.all = true
      item.isIndeterminate = true
      item.label.forEach((second:any)=> {
        item.game.push(second.value)
      })
    })
  }
}

// 游戏对应品牌
const setGameBrand = async () => {
  if(props.checkedItem.is_multi_currency){
    data.gameBrandList = []
    // 游戏对应品牌的填入
    GameBrandNum.forEach((item:any)=>{
      //label:品牌对应的游戏 all:是否全选 isIndeterminate:全选按钮 num:多少款游戏 show:是否展示 
      data.gameBrandList.push({ label:[],value:item.value,remark:item.label, all:true, isIndeterminate:true, num: 0, game: [], show:true })
    })
    data.gameBrandList.forEach((item:any)=>{
      indexStore.gameArray.forEach((second:any)=>{
        if(item.value==second.platform_backend_echo){
          item.label.push(second)
        }
      })
      item.num = item.label.length
    })
    // 选择货币【禁止货币对应的游戏】
    CurrencyGame()
    // 回显选择的游戏
    if(props.checkedItem.id){
      data.gameBrandList.forEach((item:any)=>{
        item.game = []
        props.checkedItem.gameList.forEach((second:any)=>{
          item.label.forEach((three:any)=> {
            if(three.value == second){
              item.game.push(second)
            }
          })
        })
        // 回显游戏对不上品牌游戏就不默认选中全选
        if(item.num != item.game.length){
          item.all = false
          item.isIndeterminate = false
        }
      })
    }else{
      // 默认选中所有游戏
      data.gameBrandList.forEach((item:any)=>{
        item.label.forEach((second:any)=> {
          item.game.push(second.value)
        })
      })
    }
  }
  // 设置分成比例
  data.addQuery.config_ggr = []
  if(props.checkedItem.config_ggr && props.checkedItem.config_ggr.length){
    GameBrandNum.forEach((item:any)=>{
      let radio = 0,min=0;
      props.checkedItem.config_ggr.forEach((second:any)=>{
        if(item.value==second.platform){
          radio = second.radio
        }
      })
      if( item.value == 1 ) min = 4 // Spribe
      if( item.value == 2 ) min = 3 // PG
      if( item.value == 3 ) min = 3 // JILI
      if( item.value == 4 ) min = 5 // PP
      if( item.value == 5 ) min = 3 // OMG
      if( item.value == 6 ) min = 4 // MiniGame
      if( item.value == 8 ) min = 4 // Hacksaw
      data.addQuery.config_ggr.push({ platform:item.value, radio: radio, types:2, min:min  })
    })
    data.addQuery.config_ggr = sortObjectArray(data.addQuery.config_ggr,'platform','asc')
  }else{
    GameBrandNum.forEach((item:any)=>{
      let radio = 0;
      if( item.value == 1 ) radio = 4 // Spribe
      if( item.value == 2 ) radio = 3 // PG
      if( item.value == 3 ) radio = 3 // JILI
      if( item.value == 4 ) radio = 5 // PP
      if( item.value == 5 ) radio = 3 // OMG
      if( item.value == 6 ) radio = 4 // MiniGame
      if( item.value == 8 ) radio = 4 // Hacksaw
      data.addQuery.config_ggr.push({ platform:item.value, radio: radio, types:2, min:radio  })
    })
  }
}
// 选择对应品牌的所以游戏
const handleCheckAllGame = (item: any) => {
  let gameValue = [] as any;
  item.label.forEach((second:any)=> {
    gameValue.push(second.value)
  })
  item.game = item.all ? gameValue : []
  item.isIndeterminate = false
}
const handleCheckGame = (item:any)=>{
  const checkedCount = item.game.length
  item.all = checkedCount == item.label.length
  item.isIndeterminate = checkedCount > 0 && checkedCount < item.label.length
}

// 手动关闭预存分
const changeStatus = (value:number)=>{
  if(props.checkedItem.pre_score_status && !value){
    ElMessageBox.confirm('手动关闭预存分会清除当前预存分值，确认关闭？', '提示', {
      confirmButtonText: '确认',
      cancelButtonText: '取消'
    }).then(async () => {
      data.addQuery.pre_score_status = value
    }).catch(() => {
      data.addQuery.pre_score_status = props.checkedItem.pre_score_status
    })
  }
}

// 生成秘钥
const autoKey = async () => {
  let res = await getAgentKey({})
  data.addQuery.key = res.data
}

// 取消
const addQuery = ref<FormInstance>()
const GoogleRef = ref<any>()
const handleClose = async (val?: Boolean) => {
  emit('cancel', val)
  addQuery.value!.resetFields()
  GoogleRef.value.onHideDetails()
  data.addQuery = {
    id: 0, // 总代id
    operator_name: '', //总代名称
    username: '', // 后台账号
    password: '', // 后台密码
    contact: '', //联系方式
    remark: '', // 备注
    operator_type: 0, // 是否是测试总代
    kol: 0, // 是否是kol
    white_ip: '', // IP白名单
    google_check: 0, // IP白名单
    google_url: '', // 谷歌二维码
    google_secret: '', // 谷歌二维码
    google_code: 0, // 谷歌二维码
    settlement_ratio: 1,// 结算比例
    slot_ratio: null, // slot 分成比例 百分比
    share_proportion: null, // 返佣比例
    config_ggr: [],
    // 多货币
    is_multi_currency: 0, // 0普通 1多货币
    is_show_coin_icon: 1, // pg货币是否显示
    currency_ids: '', // 币种
    currencyList: [] as any[], // 商户币种
    client_balance_scales: [] as any[], // 多货币-币种放大倍数
    pre_score_status: 0, // 预存分
    pre_store_score: 10000, // 分数
    pre_score_percent: 10, // 百分比
    domain_name: '', // 接口域名
    key: '', // 秘钥
    area: '',
    agent_request_url: '',// 商户请求地址
    api_type: 0, //  0单一 1转账
    game_ids: '', //  默认游戏ID
    gameList: [] as any[], // 商户游戏
  }
}
</script>
<style scoped lang="scss">
.game-icon{
  width: 30px;
  border-radius: 50%;
}
.width70px{
 min-width: 110px;
}
.width130{
  width: 130px;
}
.width23{
  min-width: 23%;
}
.inputAndBtn {
  display: flex;
  align-items: center;
}
</style>
